package com.dimples.system.factory;

import com.dimples.common.enums.FileServerType;
import com.dimples.common.util.SpringContextHolder;
import com.dimples.system.service.SysFileService;
import com.dimples.system.service.impl.SysFileServiceImpl;

import org.springframework.stereotype.Component;

import lombok.RequiredArgsConstructor;

/**
 * 根据配置获取对应的文件服务的处理类
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2021/6/27
 */
@Component
@RequiredArgsConstructor
public class FileServiceFactory {

    public static SysFileService fileService(FileServerType type) {
        switch (type) {
            case FTP:
                break;
            case HTTP:
                return SpringContextHolder.getBean(SysFileServiceImpl.class);
            default:
                return null;
        }
        return null;
    }

}
